<template>
    <div>
        <div class="header_shadow" :style="commonData.indexLogo==1?'background:#fff':'background:#3a89cc'">
            <header class="header" >
                <div :class="commonData.indexLogo==1?'indexHeader':'userHeader'">
                    <router-link class="logoImg" to="/home">
                        <img v-if="!commonData.indexLogo" src="/static/img/procedure/logo_b.png">
                        <img v-if="commonData.indexLogo==1" src="/static/img/procedure/logo.png">
                    </router-link>

                    <!-- <div class="littleApp" v-if="commonData.indexLittleApp==1">
                        <span>小程序</span>
                        <div class="littleAppBox">
                            <img src="/static/img/index/littleAppTan.png" class="littleAppBg">
                            <p class="littleSpan1">扫一扫关注小程序</p>
                            <img class="littleAppImg" src="/static/img/index/littleApp.png" width="160px" height="160px">
                            <p class="littleSpan2">学员使用，随时随地学习</p>
                        </div>
                    </div> -->
                    <div style="display: inline-block;float: right;" v-if="commonData.isShowUserBox==1"></div>
                    <div style="display: inline-block;float: right;" v-if="commonData.isShowUserBox!=1">
                        <template v-if="!String.isEmptyOrNUll(commonData.$parent.loginInfo.token)">
                            <template>
                                <a class="f_right commonLoginOut" @click="loginOut">
                                    <span class="header_out_img"></span>
                                    退出登录</a>
                                <router-link class="f_right commonUser" to="/cont_education/user/user_info">欢迎您，{{String.isEmptyOrNUll(commonData.$parent.loginInfo.realName)?commonData.$parent.loginInfo.userName:commonData.$parent.loginInfo.realName}}
                                    <img src="/static/img/index/user_header_icon.png" class="headerIcon1">
                                </router-link>
                            </template>
                        </template>
                        <template v-else>
                            <router-link class="f_right" to="/company_login">
                                <img src="/static/img/index/index_company.png" class="index_header_icon" width="20px"
                                    height="20px" />
                                企业入口</router-link>
                            <router-link class="f_right" style="margin-right: 30px" to="/login">
                                <img src="/static/img/index/index_person.png" class="index_header_icon" width="20px"
                                    height="20px" />
                                学员入口</router-link>
                        </template>
                    </div>
                </div>
            </header>
        </div>
        <slot></slot>
        <footer class="footer text_center">
            <div class="footer_box text_left">
                <p class="footer_p">
                    <img src="/static/img/index/footer_question.png" alt="">
                    <span class="footer_question">常见问题</span>
                </p>
                <ul class="footer_question_ul">
                    <!-- <li><span class="footer_circle"></span><router-link target="_blank" to="/common_question/question1/1">什么时间生成考试报名的准考证？</router-link></li> -->
                    <!-- <li><span class="footer_circle"></span><router-link target="_blank" to="/common_question/question1/2">补考怎么申请？</router-link></li> -->
                    <li><span class="footer_circle"></span><router-link target="_blank" to="/common_question/question1/3">关于继续教育视频的观看有效期？</router-link></li>
                </ul>
                <div class="clear"></div>
                <div class="clear"></div>
                <!-- <p class="footer_copyRight text_center"><a target="_blank" style="color: #FFFFFF;" href="http://beian.miit.gov.cn">©CopyRight 2009-2021 湖州市建筑业行业协会 http://www.hzjxfwpt.com 浙ICP备2021005626号-1</a></p> -->
                <p class="footer_copyRight text_center"><a target="_blank" style="color: #FFFFFF;" href="http://beian.miit.gov.cn">©CopyRight 2009-2021 城建职业技能培训学校 http://hzcjpx.com 浙ICP备2021005626号-1</a></p>
            <!-- <p class="home_footer_copyrighyt">©CopyRight 2009-2019 湖州市建筑业行业协会 http://www.hzjxfwpt.com 浙ICP备19043883号-1</p> -->
            </div>
        </footer>
    </div>
</template>

<script>
    export default {
        props: ["commonData"],
        data: function() {
            return {

            }
        },
        mounted: function() {
            // console.log(this.commonData.$parent.loginInfo)
        },
        methods: {
            loginOut: function() {
                this.$cookies.remove('loginInfo');
                this.$cookies.remove('token');
                this.$cookies.remove('tzgApplyTrainDescriptFee');
                this.$cookies.remove('slryApplyTrainDescriptFee');
                localStorage.clear();
                this.common.toPage("/login");
            }
        }
    }
</script>

<style>
    .header_out_img {
        background-image: url(/static/img/index/out_header_icon_b.png);
    }

</style>
